﻿@model PSU.Model.Areas.Administrator.Basic.StaffEditViewModel
@using PSU.Model.Areas
@{
    ViewData["Title"] = "教师账户";
    ViewData["NavTitle"] = "基础信息管理";
    ViewData["CurrName"] = "职工账户管理";
}

<section class="content-header">
    <h1>
        职工账户
        <small>Staff Data</small>
    </h1>
    <ol class="breadcrumb">
        <li>
            <a asp-area="Administrator" asp-controller="Home" asp-action="Index">
                <i class="fa fa-dashboard"></i> 首页
            </a>
        </li>
        <li>基础信息</li>
        <li>
            <a asp-area="Administrator" asp-controller="Basic" asp-action="Staff">
                职工账户
            </a>
        </li>
        <li class="active">编辑</li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" role="form" id="edit_form">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-solid">
                            <div class="box box-header">
                                <div class="box-title">账户信息</div>
                            </div>
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-md-2 col-xs-3 control-label no-padding-right" for="account">
                                        <span class="required-label">*</span> 登录账户名
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        @{
                                            if (string.IsNullOrEmpty(Model.Account))
                                            {
                                                <input class="form-control" id="account" asp-for="Account" type="text">
                                            }
                                            else
                                            {
                                                <input class="form-control" id="account" asp-for="Account" type="text" readonly>
                                            }
                                        }
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label no-padding-right col-md-2 col-xs-3" for="password">
                                        <span class="required-label">*</span> 登录密码
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <input id="password" type="password" class="form-control" asp-for="Password" value="123456789">
                                    </div>
                                    <strong>
                                        <i class="fa fa-file-text-o margin-r-5" style="margin-top:9px;"></i>
                                        默认密码：123456789
                                    </strong>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 col-xs-3 control-label no-padding-right" for="email">
                                        邮箱地址
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <input class="form-control" id="email" type="email" asp-for="Email">
                                    </div>
                                    <label class="col-md-2 control-label no-padding-right" for="phone">
                                        手机号
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <input class="form-control" id="phone" type="tel" asp-for="Phone">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-solid">
                            <div class="box box-header">
                                <div class="box-title">个人信息</div>
                            </div>
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-md-2 col-xs-3 control-label no-padding-right" for="name">
                                        <span class="required-label">*</span> 用户姓名
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <input class="form-control" id="name" type="text" asp-for="Name">
                                    </div>
                                    <label class="col-md-1 col-xs-3 control-label no-padding-right" for="gender">
                                        性别
                                    </label>
                                    <div class="col-md-2 col-xs-9" style="margin-top:5px;">
                                        @if (Model.Gender)
                                        {
                                            <input type="radio" class="iradio_flat-green" name="gender" value="true" checked><span>男</span>
                                            <input type="radio" class="iradio_flat-green" name="gender" value="false"><span>女</span>
                                        }
                                        else
                                        {
                                            <input type="radio" class="iradio_flat-green" name="gender" value="true"><span>男</span>
                                            <input type="radio" class="iradio_flat-green" name="gender" value="false" checked><span>女</span>
                                        }
                                    </div>
                                    <label class="col-md-1 col-xs-3 control-label no-padding-right" for="age">
                                        年龄
                                    </label>
                                    <div class="col-md-1 col-xs-9">
                                        <input class="form-control" id="age" type="number" asp-for="Age">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 col-xs-3 control-label no-padding-right" for="idnumber">
                                        <span class="required-label">*</span> 身份证号
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <div class="input-group">
                                            <input class="form-control" id="idnumber" type="text" asp-for="IdNumber">
                                            <div class="input-group-addon">
                                                <i class="fa fa-id-card"></i>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 col-xs-3 control-label no-padding-right" for="wechat">
                                        微信号
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <div class="input-group">
                                            <input class="form-control" id="wechat" type="text" asp-for="Wechat">
                                            <div class="input-group-addon">
                                                <i class="fa fa-wechat text-green"></i>
                                            </div>
                                        </div>
                                    </div>
                                    <label class="col-md-2 col-xs-3 control-label no-padding-right" for="qq">
                                        QQ号
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <div class="input-group">
                                            <input class="form-control" id="qq" type="text" asp-for="QQ">
                                            <div class="input-group-addon">
                                                <i class="fa fa-qq text-blue"></i>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label no-padding-right" for="department">
                                        <span class="required-label">*</span> 所属院系
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <select id="department" class="form-control">
                                            <option value="-1">请选择</option>
                                            @{
                                                if (Model != null && Model.DepartmentList != null && Model.DepartmentList.Any())
                                                {
                                                    foreach (var item in Model.DepartmentList.AsReadOnly())
                                                    {
                                                        if (item.Name.Equals(Model.DepartmentName))
                                                        {
                                                            <option value="@item.Id" selected="selected">@item.Name</option>
                                                        }
                                                        else
                                                        {
                                                            <option value="@item.Id">@item.Name</option>
                                                        }
                                                    }
                                                }
                                            }
                                        </select>
                                    </div>
                                    <label class="col-md-2 control-label no-padding-right" for="deptnumber">
                                        <span class="required-label">*</span> 院系编号
                                    </label>
                                    <div class="col-md-3 col-xs-9">
                                        <div class="input-group">
                                            <input type="text" id="deptnumber" class="form-control" asp-for="DepartmentId" readonly />
                                            <span class="input-group-addon">
                                                <i class="fa fa-id-card-o fa-flip-horizontal"></i>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label no-padding-right" for="enable"> 是否启用 </label>
                                    <div class="col-md-3 col-xs-9">
                                        <select id="enable" asp-items="@Html.GetEnumSelectList(typeof(EnumType.Enable))" class="form-control" asp-for="IsEnabled"></select>
                                    </div>
                                    <label class="col-md-2 control-label no-padding-right"> 是否为院系负责人 </label>
                                    <div class="col-md-2 col-xs-9" style="margin-top:5px;">
                                        @if (Model.IsMaster)
                                        {
                                            <input type="radio" class="iradio_flat-green" name="master" value="true" checked><span>是</span>
                                            <input type="radio" class="iradio_flat-green" name="master" value="false"><span>否</span>
                                        }
                                        else
                                        {
                                            <input type="radio" class="iradio_flat-green" name="master" value="true"><span>是</span>
                                            <input type="radio" class="iradio_flat-green" name="master" value="false" checked><span>否</span>
                                        }
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label no-padding-right" for="address">
                                        联络地址
                                    </label>
                                    <div class="col-md-8 col-xs-9">
                                        <input class="form-control" id="address" type="text" asp-for="Address">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clearfix">
                    <div class="text-right">
                        <a class="btn btn-success col-md-offset-2" id="save" data-id="@Model.Id">
                            <i class="fa fa-check"></i>
                            保存
                        </a>
                        &nbsp;&nbsp;
                        <a class="btn btn-default" asp-area="Administrator" asp-controller="Basic" asp-action="Staff">
                            <i class="fa fa-undo"></i>
                            返回
                        </a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>

@section scripts{
    <environment include="Development">
        <script src="~/javascript/view/Administrator/editstaff.js"></script>
    </environment>
    <environment exclude="Development">
        <script src="~/javascript/view/Administrator/editstaff.min.js" asp-append-version="true"></script>
    </environment>
}